package com.jof.framework.i18n.interceptor;

import java.util.Locale;

import org.springframework.context.i18n.LocaleContextHolder;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.I18nInterceptor;

/**
 * 扩展struts2默认的i18n拦截器，添加设置local到LocaleContextHolder中的功能
 * @author Jonathan
 * @see com.opensymphony.xwork2.interceptor.I18nInterceptor
 * @see org.springframework.context.i18n.LocaleContextHolder
 */
public class I18nResolverInterceptor extends I18nInterceptor {
	private static final long serialVersionUID = 5888969294461266478L;

	
	protected void saveLocale(ActionInvocation invocation, Locale locale) {
		super.saveLocale(invocation, locale);
		LocaleContextHolder.setLocale(locale);
	}
}
